package at.fhj.itm11.forum.gui;

import static org.junit.Assert.assertEquals;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.support.PageFactory;

import at.fhj.itm11.forum.gui.pages.BasePage;

public class US01 extends AbstractGUITest {
	@Test
	public void testLoginOK() throws Exception {
		String userName = "fhj", password = "fhj";

		login(userName, password);

		BasePage basePage = PageFactory.initElements(driver, BasePage.class);

		assertEquals("Eingeloggt als: " + userName,
				basePage.loggedInName.getText());
		driver.findElement(By.linkText("Ausloggen")).click();
	}
}
